package com.s.core.persist.mapper;

import com.s.core.root.Basic;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author zhangjiangnan
 */
@Mapper
public interface BasicMapper {

    @Select("select code,name from basic")
    List<Basic> findBasicList();

    /**
     * 新增个股
     */
    @Insert("insert into basic(code, name) values(#{code}, #{name})")
    int add(@Param("code") String code, @Param("name") String name);

    /**
     * 删除个股
     */
    @Update("delete from basic where code = #{code}")
    int del(@Param("code") String code);

    /**
     * 更新个股名称
     */
    @Update("update basic set name = #{name} where code = #{code}")
    int rename(@Param("code") String code, @Param("name") String name);
}